CREATE TABLE [dbo].[TMSACA_DIAR]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL CONSTRAINT [DF__TMSACA_DI__CO_EM__202DAF9E] DEFAULT ('S'),
[CO_CAJA] [dbo].[TD_VC_008] NOT NULL,
[AA_CAJA] [dbo].[TD_VC_004] NOT NULL,
[MM_CAJA] [dbo].[TD_VC_002] NOT NULL,
[DD_CAJA] [dbo].[TD_VC_002] NOT NULL,
[FE_CAJA] [dbo].[TD_DT_001] NOT NULL,
[UL_CORR_INGR] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TMSACA_DI__UL_CO__2121D3D7] DEFAULT ((0)),
[UL_CORR_EGRE] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TMSACA_DI__UL_CO__2215F810] DEFAULT ((0)),
[UL_CORR_INEG] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TMSACA_DI__UL_CO__230A1C49] DEFAULT ((0)),
[IM_SALD_INIC] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TMSACA_DI__IM_SA__23FE4082] DEFAULT ((0)),
[IM_INGR] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TMSACA_DI__IM_IN__24F264BB] DEFAULT ((0)),
[IM_EGRE] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TMSACA_DI__IM_EG__25E688F4] DEFAULT ((0)),
[TI_SITU] [dbo].[TD_VC_003] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TMSACA_DI__CO_US__26DAAD2D] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMSACA_DI__FE_US__27CED166] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TMSACA_DI__CO_US__28C2F59F] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMSACA_DI__FE_US__29B719D8] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMSACA_DIAR] ADD CONSTRAINT [PK__TMSACA_D__AD92E7B97207BD92] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_CAJA], [AA_CAJA], [MM_CAJA], [DD_CAJA]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMSACA_DIAR] ADD CONSTRAINT [FK__TMSACA_DIAR__16651999] FOREIGN KEY ([CO_EMPR], [CO_CAJA]) REFERENCES [dbo].[TMCAJA] ([CO_EMPR], [CO_CAJA])
GO
